(function($){
	$.fn.jtab = function(o){
		var d = {
			event : "mouseover",
			speed : "fast",
			ease  : "easeOutQuad"
		};
		
		o = $.extend(d, o);
		
		return this.each(function(){
			var oThis = $(this);
			var oTab  = $(".tab-nav",oThis);
			var oContain = $(".options",oThis);
			var panel = $(".panel",oContain);
			oContain.height(panel.length * panel.height());
			
			$("span",oTab).eq(0).addClass("hover");
			
			var slide = function(pos){
				oContain.stop().animate({
					top : -	pos * panel.height()		 
				},{duration : o.speed, easing : o.ease });
			};
			
			$("span",oTab).bind(o.event,function(){
				var index = $("span",oTab).index(this);
				$("span",oTab).removeClass("hover").eq(index).addClass("hover");
				slide(index);
			});
			
		});
	};
})(jQuery);